﻿<html>
<title>Monitor</title>
<head>
<meta charset="UTF-8">
<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.js"></script>

<link rel="stylesheet" href="http://cdn.amazeui.org/amazeui/2.5.0/css/amazeui.css">
<link rel="stylesheet" href="http://cdn.amazeui.org/amazeui/2.5.0/css/amazeui.min.css">

<script src="http://cdn.amazeui.org/amazeui/2.5.0/js/amazeui.js"></script>
<script src="http://cdn.amazeui.org/amazeui/2.5.0/js/amazeui.min.js"></script>
<script src="http://cdn.amazeui.org/amazeui/2.5.0/js/amazeui.ie8polyfill.js"></script>
<script src="http://cdn.amazeui.org/amazeui/2.5.0/js/amazeui.ie8polyfill.min.js"></script>
<script src="http://cdn.amazeui.org/amazeui/2.5.0/js/amazeui.widgets.helper.js"></script>
<script src="http://cdn.amazeui.org/amazeui/2.5.0/js/amazeui.widgets.helper.min.js"></script>
<script type="text/javascript">
function refresh_1_sec(){
	$.ajax({
		url:"/../monitor/CurrentOnline",
		success:function(data){
				var obj = jQuery.parseJSON(data); 
				$("#CURRENT_ONLINE").html(obj.Count);
			}
		});
		
	$.ajax({
		url:"/../monitor/TotalUsers",
		success:function(data){
				var obj = jQuery.parseJSON(data); 
				$("#TOTAL_USERS").html(obj.Count);
			}
		});
		
	$.ajax({
		url:"/../monitor/TotalView",
		success:function(data){
				var obj = jQuery.parseJSON(data); 
				$("#TOTAL_VIEW").html(obj.Count);
			}
		});
		
	$.ajax({
		url:"/../monitor/PlayGame",
		success:function(data){
				var obj = jQuery.parseJSON(data); 
				$("#PLAY_GAME").html(obj.Count);
			}
		});
		
	$.ajax({
		url:"/../monitor/ViewPage",
		success:function(data){
				var obj = jQuery.parseJSON(data); 
				$("#VIEW_PAGE").html(obj.Count);
			}
		});
		
	$.ajax({
		url:"/../monitor/StartGame",
		success:function(data){
				var obj = jQuery.parseJSON(data); 
				$("#START_GAME").html(obj.Count);
			}
		});
		
	$.ajax({
		url:"/../monitor/TaunterOther",
		success:function(data){
				var obj = jQuery.parseJSON(data); 
				$("#TAUNTER_OTHER").html(obj.Count);
			}
		});
		
	$.ajax({
		url:"/../monitor/ShareFirends",
		success:function(data){
				var obj = jQuery.parseJSON(data); 
				$("#ShareFirends").html(obj.Count);
			}
		});
		
	$.ajax({
		url:"/../monitor/ShareTimeline",
		success:function(data){
				var obj = jQuery.parseJSON(data); 
				$("#ShareTimeline").html(obj.Count);
			}
		});
		
	$.ajax({
		url:"/../monitor/ShareFirendUsers",
		success:function(data){
				var obj = jQuery.parseJSON(data); 
				$("#ShareFirendUsers").html(obj.Count);
			}
		});
		
	$.ajax({
		url:"/../monitor/ShareTimelineUser",
		success:function(data){
				var obj = jQuery.parseJSON(data); 
				$("#ShareTimelineUser").html(obj.Count);
			}
		});
		
	$.ajax({
		url:"/../monitor/AvgCostTime",
		success:function(data){
				var obj = jQuery.parseJSON(data); 
				$("#AvgCostTime").html(obj.Count);
			}
		});
	
	$.ajax({
		url:"/../monitor/MaxTimeCost",
		success:function(data){
				var obj = jQuery.parseJSON(data); 
				$("#MaxTimeCost").html(obj.Count);
			}
		});	
		
}

$(document).ready(function(){
	refresh_1_sec();
	refresh_best_score();
	setInterval(refresh_1_sec,1000);
	setInterval(refresh_best_score, 60*1000);
});

function refresh_best_score()
{
	$.ajax({
		url:"/../monitor/BestScore",
		success:function(data){
				var obj = jQuery.parseJSON(data); 
				var htmlStr = ""
				for ( var p in obj ){
					if (typeof(obj[p]) == "function"){
					} else {
						htmlStr+='<li class="am-g;"><label class="am-list am-list-static am-list-border am-text-success">{SOCRE}:</label><strong style="float:right" class="am-text-xxxl am-text-danger "  id="VIEW_PAGE">{NUM}</strong></li>'
						htmlStr = htmlStr.replace("{SOCRE}", "达到"+p.substr(14))
						htmlStr = htmlStr.replace("{NUM}", obj[p])
					} 
				}
				$("#best_score").html(htmlStr);
			}
		});
	
}
</script>
</head>
<body>



<div style="font-size:15">
  
  <div data-am-widget="list_news" class="am-list-news am-list-news-default am-text-xxl " >
  <!--列表标题-->
    <div class="am-list-news-hd am-cf am-text-secondary">
          <h1>摘星兔数据</h1>
    </div>

  <div class="am-list-news-bd">
  <ul class="am-list">

		<li class="am-g;"><label class="am-list am-list-static am-list-border am-text-success">当前在人线:</label><strong style="float:right" class="am-text-xxxl am-text-danger " id="CURRENT_ONLINE"></strong></li>
		<li class="am-g;"><label class="am-list am-list-static am-list-border am-text-success">总登陆玩家数:</label><strong style="float:right" class="am-text-xxxl am-text-danger "  id="TOTAL_USERS"></strong></li>
		<li class="am-g;"><label class="am-list am-list-static am-list-border am-text-success">总浏览玩家数:</label><strong style="float:right" class="am-text-xxxl am-text-danger "  id="TOTAL_VIEW"></strong></li>
		<li class="am-g;"><label class="am-list am-list-static am-list-border am-text-success">历史登陆游戏人次:</label><strong style="float:right" class="am-text-xxxl am-text-danger "  id="START_GAME"></strong></li>
		<li class="am-g;"><label class="am-list am-list-static am-list-border am-text-success">历史浏览网页人次:</label><strong style="float:right" class="am-text-xxxl am-text-danger "  id="VIEW_PAGE"></strong></li>
		<li class="am-g;"><label class="am-list am-list-static am-list-border am-text-success">总游戏局数:</label><strong style="float:right" class="am-text-xxxl am-text-danger "  id="PLAY_GAME"></strong></li>
		<li class="am-g;"><label class="am-list am-list-static am-list-border am-text-success">得瑟数:</label><strong style="float:right" class="am-text-xxxl am-text-danger "  id="TAUNTER_OTHER"></strong></li>
		<li class="am-g;"><label class="am-list am-list-static am-list-border am-text-success">分享朋友圈总数:</label><strong style="float:right" class="am-text-xxxl am-text-danger "  id="ShareTimeline"></strong></li>
		<li class="am-g;"><label class="am-list am-list-static am-list-border am-text-success">分享好友总数:</label><strong style="float:right" class="am-text-xxxl am-text-danger "  id="ShareFirends"></strong></li>
		<li class="am-g;"><label class="am-list am-list-static am-list-border am-text-success">分享朋友圈人数:</label><strong style="float:right" class="am-text-xxxl am-text-danger "  id="ShareTimelineUser"></strong></li>
		<li class="am-g;"><label class="am-list am-list-static am-list-border am-text-success">分享好友人数:</label><strong style="float:right" class="am-text-xxxl am-text-danger "  id="ShareFirendUsers"></strong></li>
</p>
		<li class="am-g;"><label class="am-list am-list-static am-list-border am-text-success">平均耗时(登陆/榜)ns:</label><strong style="float:right" class="am-text-xxxl am-text-danger "  id="AvgCostTime"></strong></li>
		<li class="am-g;"><label class="am-list am-list-static am-list-border am-text-success">最大耗时(登陆/榜)ns:</label><strong style="float:right" class="am-text-xxxl am-text-danger "  id="MaxTimeCost"></strong></li>

		<li class="am-g;">
		<section data-am-widget="accordion" class="am-accordion am-accordion-gapped" >
		  <dl class="am-accordion-item am-active">
			<dt class="am-accordion-title">
			  最高分列表
			</dt>
			<dd class="am-accordion-bd am-collapse ">
			  <div class="">
			  <ul class="am-list">
				<li class="am-g" id="best_score">
				<ul class="am-list">
				</ul>
				</li>
			  </ul>
			  </div>
			</dd>
		  </dl>
	  </section>
  </li>

  </ul>
  </div>
  
 </div>
  
</div> 

</body>
</html>
